package com.darren.center.design.patterns.command;

import java.util.HashMap;
import java.util.Map;

/**
 * <h3>design-patterns</h3>
 * <p></p>
 *
 * @author : Darren
 * @date : 2021年06月14日 19:48:34
 **/
public class BaseActionMapper implements ActionMapper {

    protected Map<String, Action> mapper = new HashMap<>(40);

    @Override
    public synchronized void addAction(String key,Action action) {
        mapper.put(key, action);
    }

    @Override
    public Action findAction(String key) {
        return mapper.get(key);
    }

}

